package app_config

import (
	"fmt"
	"github.com/mattermost/viper"
)

type MysqlConfig struct {
	User     string
	Password string
	Host     string
	Port     int
	Database string
}
type AppConfig struct {
	MysqlConfig
}

var AppConf AppConfig

func InItConfig() {
	viper.SetConfigFile("./app_config/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("配置文件读取失败")
		return
	}
	viper.Unmarshal(&AppConf)
	fmt.Println("配置文件读取成功")
}
